import _axios from './axios';

// 添加订单
function addorder(goods_info,addr_id) {
    return _axios({
        url: "/order",
        method: "POST",
        data:{
            goods_info,
            addr_id
        },
        headers:{
            "x-token":sessionStorage.getItem("token")
        }
    })
}
// 获取单条订单
function getorder(id) {
    return _axios({
        url: "/order/"+id,
        method: "GET",
        params:{
            limit:6,
            page:3,
            id
        },
        headers:{
            "x-token":sessionStorage.getItem("token")
        }
    })
}

// 获取所有订单
function getAllorder() {
    return _axios({
        url: "/order",
        method: "GET",
        headers:{
            "x-token":sessionStorage.getItem("token")
        }
    })
}


export  {addorder,getorder,getAllorder};